package com.tieland.xunda.common.sys;

import net.buffalo.service.ServiceFactory;
import net.buffalo.service.NoSuchServiceException;
import net.buffalo.service.ServiceCreationFailException;

/**
 * User: qiukx
 * Date: 2008-7-29
 * Company: Freshpower
 * Description:
 */
public class PicoServiceFactory implements ServiceFactory {
    private static ServerContext serverContext = ServerContext.getInstance();
    public Object getService(String serviceId, String serviceName) throws NoSuchServiceException, ServiceCreationFailException {
        try {
            Class clazz = Class.forName(serviceName);
            return serverContext.getMicroContainer().getComponent(clazz);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
